package com.first.mapper;


import com.first.entity.ClassEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ClassMapper {

    @Select("select * from class")
    List <ClassEntity> getClassList();

    @Update("update class set classname=#{className},classtype=#{classType},classnumber=#{classNumber} where id=#{id}")
    int updateClass(@Param("className") String className,@Param("classType") String classType,@Param("classNumber") Integer classNumber,@Param("id") Integer id);

    @Delete("delete from class where id=#{id}")
    int deleteClass(@Param("id") Integer id);

    @Insert("insert into class values(null,#{className},#{classType},#{classNumber})")
    int insertClass(@Param("className") String className,@Param("classType") String classType,@Param("classNumber") Integer classNumber);


}
